import {Icon} from 'antd';
import {WeaRichText} from 'ecCom';
import '../style/index.css';
import WeaContractCk from '../../../comp/weaContractCk/index';
import ReplyItem from './ReplyItem';

export default class CommentItem extends React.Component {
    constructor(props){
        super(props);
        this.state=({
            showCommentCk:false
        });
    }

	render() {
        const {showCommentCk} = this.state;
		
		return (
            
            <div className={"wea-contract-dynamic-comment"}>
                <div className={"wea-contract-dynamic-comment-div"}>
                    <div className={"wea-contract-dynamic-comment-header"}>
                        <img src={"/messager/images/icon_m_wev8.jpg"}/>
                    </div>
                    <div className={"wea-contract-dynamic-comment-content"}>
                        <div>
                            <span><a href={`javaScript:openhrm(1);`} onClick={window.pointerXY}>系统管理员</a></span>
                        </div>
                        <div className={"content-remark"}>
                            咱们这里提交的问题，在那里看是否排入开发计划，在那里看？
                        </div>
                        <div className={"content-remark-reply"}>
                            <ReplyItem />
                            <ReplyItem />
                        </div>
                        <div className="bottom-operate">
                            <span className={"operate-time"}>2017年4月21日 09:29</span>
                            <span className={"operate-content"} onClick={()=>this.doShowCommentCk(true)}><span><i className={'icon-coms-New-SMS'}/>评论</span> </span>
                        </div>
                        {showCommentCk&&<WeaContractCk editorId={'reply'} isShowSignInput={true} actions={{onCancelComment:this.doShowCommentCk.bind(this),onPublicComment:this.onPublicComment.bind(this)}} onChange={()=>this.onCommentChange.bind(this)}/>}
                    </div>
                    
                    
                </div>
                
            </div>
        );
    };
    

    onCommentChange=(obj,bool)=>{
		console.log(obj,bool);
	}

	onPublicComment=()=>{
		console.log('onPublicComment');
		this.doShowCommentCk(false);
	}


	doShowCommentCk =(bool) =>{
		this.setState({ showCommentCk: bool});
	}
}
